import { createClient } from 'redis'
import { REDIS_HOST, REDIS_PORT } from './config'

const redisClient = createClient({
  socket: {
    host: REDIS_HOST,
    port: REDIS_PORT,
  },
})

redisClient.on('error', (err: any) => {
  console.error('redis连接失败:', err)
})

redisClient.connect().then(() => {
  console.log('redis连接成功~')
})

export default redisClient
